var top250 = "http://47.108.197.28:4000/api/movie/top250";
var hot = "http://47.108.197.28:4000/api/movie/inTheaters";
var comingSoon = "http://47.108.197.28:4000/api/movie/comingSoon";
$.ajax({
    url:top250,
    success:res=>{
        res.res.slice(0,3).forEach(item=>{
            var {title,pic} = item;
            var temple = `
                <div>
                    <img src="https://images.weserv.nl/?url=${pic}" alt="">
                    <p>${title}</p>
                </div>
            `
            $(".movie").eq(0).append(temple);
        })
    }
})
$.ajax({
    url:hot,
    success:res=>{
        res.res.slice(0,3).forEach(item=>{
            var {title,pic} = item;
            var temple = `
                <div>
                    <img src="https://images.weserv.nl/?url=${pic}" alt="">
                    <p>${title}</p>
                </div>
            `
            $(".movie").eq(1).append(temple);
        })
    }
})
$.ajax({
    url:comingSoon,
    success:res=>{
        res.res.slice(0,3).forEach(item=>{
            var {title,pic} = item;
            var temple = `
                <div>
                    <img src="https://images.weserv.nl/?url=${pic}" alt="">
                    <p>${title}</p>
                </div>
            `
            $(".movie").eq(2).append(temple);
        })
    }
})